Skip to content

Conversation

TimWolla
Copy link
Member

No description provided.

@TimWolla TimWolla requested a review from kocsismate as a code owner August 28, 2025 22:40
@TimWolla TimWolla marked this pull request as draft August 28, 2025 23:14
@TimWolla
Copy link
Member Author

This depends on another cleanup that I've not yet proposed. Putting on Draft until that happened.

The `php_uri_free()` function already unconditionally called `->free_uri()` and
thus couldn't be safely used when the `->uri` was `NULL` for some reason.

The lexbor implementation was already safe, because `lxb_url_destroy()` is
guaranteed to be a noop for `NULL`.
This implicitly fixes an `UNEXPECTED(…->uri != NULL)` in `uri_free_obj_handler`
that likely should have read `EXPECTED` instead.
@TimWolla TimWolla marked this pull request as ready for review September 8, 2025 11:48
@TimWolla TimWolla requested a review from nielsdos September 8, 2025 11:48
Copy link
Member

@nielsdos nielsdos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I don't particularly care if this is safe to call with NULL or not, but this is OK from a technical PoV.

@TimWolla
Copy link
Member Author

TimWolla commented Sep 9, 2025

Failures are do to the known ext/intl leak. Merging.

@TimWolla TimWolla merged commit 4c04ff3 into php:master Sep 9, 2025
5 of 9 checks passed
@TimWolla TimWolla deleted the uri-free-nullsafe branch September 9, 2025 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants